package com.black.contracts.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.black.contracts.mapper.ContractsMapper;
import com.black.contracts.domain.Contracts;
import com.black.contracts.service.IContractsService;

/**
 * 租赁合同Service业务层处理
 * 
 * @author gugu
 * @date 2024-10-13
 */
@Service
public class ContractsServiceImpl implements IContractsService 
{
    @Autowired
    private ContractsMapper contractsMapper;

    /**
     * 查询租赁合同
     * 
     * @param contractId 租赁合同主键
     * @return 租赁合同
     */
    @Override
    public Contracts selectContractsByContractId(Long contractId)
    {
        return contractsMapper.selectContractsByContractId(contractId);
    }

    /**
     * 查询租赁合同列表
     * 
     * @param contracts 租赁合同
     * @return 租赁合同
     */
    @Override
    public List<Contracts> selectContractsList(Contracts contracts)
    {
        return contractsMapper.selectContractsList(contracts);
    }

    /**
     * 新增租赁合同
     * 
     * @param contracts 租赁合同
     * @return 结果
     */
    @Override
    public int insertContracts(Contracts contracts)
    {
        return contractsMapper.insertContracts(contracts);
    }

    /**
     * 修改租赁合同
     * 
     * @param contracts 租赁合同
     * @return 结果
     */
    @Override
    public int updateContracts(Contracts contracts)
    {
        return contractsMapper.updateContracts(contracts);
    }

    /**
     * 批量删除租赁合同
     * 
     * @param contractIds 需要删除的租赁合同主键
     * @return 结果
     */
    @Override
    public int deleteContractsByContractIds(Long[] contractIds)
    {
        return contractsMapper.deleteContractsByContractIds(contractIds);
    }

    /**
     * 删除租赁合同信息
     * 
     * @param contractId 租赁合同主键
     * @return 结果
     */
    @Override
    public int deleteContractsByContractId(Long contractId)
    {
        return contractsMapper.deleteContractsByContractId(contractId);
    }
}
